{% extends 'common/panel.html' %}

{% block panel %}
{% load humanize %}
{% load analysis_extras %}

<h3>Area</h3>
<div class='freetext'>
<p>
<table  style='width:430px' class='analysis_report_container'>
    <tbody>
        <tr class="grey">
            <td colspan='2'><b>Overall Size of Bioregion</b></td>
        </tr>
        <tr>
            <td colspan='2'>{{area_km|intcomma}} km<sup>2</sup> / {{area_mi|intcomma}} mi<sup>2</sup></td>
        </tr>
        <tr><td></td><td></td></tr>
        <tr><td></td><td></td></tr>
        <tr class="grey">
            <td colspan='2'><b>Terrestrial</b></td>
        </tr>
        <tr>
            <td colspan='2'>{{terra_area_km|intcomma}} km<sup>2</sup> / {{terra_area_mi|intcomma}} mi<sup>2</sup></td>
        </tr>
        <tr><td></td><td></td></tr>
        <tr><td></td><td></td></tr>
        <tr class="grey">
            <td colspan='2'><b>Oceanic</b></td>
        </tr>
        <tr>
            <td colspan='2'>{{oceanic_area_km|intcomma}} km<sup>2</sup> / {{oceanic_area_mi|intcomma}} mi<sup>2</sup></td>
        </tr>
        <tr><td></td><td></td></tr>
        <tr><td></td><td></td></tr>
    </tbody>
</table>
</div>

<h3>Population</h3>
<div class='freetext'>
<p>
<table  style='width:430px' class='analysis_report_container'>
    <tbody>
        <tr class="grey">
            <td colspan='2'>
                <b>Estimated Population (2005)</b>
                <sup><a id="displayText" href="javascript:toggleDiv('pop05');">Learn More</a><sup>
                <div id="pop05" style="display: none">
                    <p>Gridded Population of the World version3 (GPWv3) data represents global population estimated for 2005.  
                    <p>The data is produced by the Columbia University Center for 
                       International Earth Science Information Network (CIESIN) in collaboration with Centro 
                       Internacional de Agricultura Tropical (CIAT).  
                    <p>In order to create a continuous population 
                       surface, CIESIN uses a proportional allocation gridding algorithm, utilizing more than 
                       300,000 national and sub-national administrative units.
                    <p>Complete documentation can be found 
                      <a href="http://sedac.ciesin.columbia.edu/gpw/documentation.jsp" target="_blank">here</a>.
                </div>
            </td>
        </tr>
        <tr>
            <td  colspan='2'>
            {% if population_2005 == 0 %}
                No Data Available
            {% else %}
                {% if population_2005 < 1000000 %}
                    {{population_2005|intcomma}}
                {% else %}
                    {{population_2005|intword}}
                {% endif %}
            {% endif %}
            </td>
        </tr>
        <tr><td></td><td></td></tr>
        <tr><td></td><td></td></tr>
        <tr class="grey">
            <td colspan='2'>
                <b>Estimated Urban Population</b>
                <sup><a id="displayText" href="javascript:toggleDiv('urban');">Learn More</a><sup>
                <div id="urban" style="display: none">
                    <p>The urban population estimate was generated by overlaying urban extent data with population estimates for 2005.  
                    <p>The data is produced by the Columbia University Center for International Earth Science Information Network (CIESIN) 
                       in collaboration with Centro Internacional de Agricultura Tropical (CIAT).
                    <p>Complete documentation and metadata can be found 
                       <a href="http://sedac.ciesin.columbia.edu/gpw/documentation.jsp" target="_blank">here</a>.
                    <!--<p>This report is based on the Global Rural-Urban Mapping Project (GRUMP) Data Collection, Alpha version
                    <p>More information on the GRUMP dataset can be found <a href="http://sedac.ciesin.columbia.edu/gpw/metadata3.jsp" target="_blank">here</a>.
                    -->
                </div>
            </td>
        </tr>
        <tr>
            <td colspan='2'>
                {% if urban_pop.0 == 0 %}
                    0 (No urban boundaries were reported)
                {% else %}
                    {% if urban_pop.0 < 1000000 %} 
                        {{urban_pop.0|floatformat:0|intcomma}} 
                    {% else %}
                        {{urban_pop.0|floatformat:0|intword}}
                    {% endif %}
                    ({{urban_pop.1|percentage:0}})
                {% endif %}
            </td>
        </tr>
        <tr><td></td><td></td></tr>
        <tr><td></td><td></td></tr>
        <tr class="grey">
            <td colspan='2'>
                <b>Projected Population (for 2015)</b>
                <sup><a id="displayText" href="javascript:toggleDiv('pop15');">Learn More</a><sup>
                <div id="pop15" style="display: none">
                    <p>This data represents global population projected for 2015.  
                    <p>The data is produced by the Columbia University Center for International Earth Science Information Network (CIESIN) 
                       in collaboration with Centro Internacional de Agricultura Tropical (CIAT).  
                    <p>The Gridded Population of the World: Future Estimates, 2015 (GPW2015) provides estimates of the world's population 
                       by country and continent, for the year 2015 and converts the distribution of human population from sub-national 
                       units to a series of 2.5 arc-minute quadrilateral grids. 
                    <p>This 2015 data product is entirely derived from the spatial and population input data used to construct the 
                       Gridded Population of the World version3 (GPWv3) (CIESIN and CIAT, 2005). This is comprised of administrative 
                       boundary and associated population data.
                    <p>Complete documentation can be found 
                       <a href="http://sedac.ciesin.columbia.edu/gpw/documentation.jsp" target="_blank">here</a>.
                </div>
            </td>
        </tr>
        <tr>
            <td colspan='2' style='width:225px'>
            {% if population_2015 == 0 %}
                No Data Available
            {% else %}
                {% if population_2015 < 1000000 %}
                    {{population_2015|intcomma}}
                {% else %}
                    {{population_2015|intword}}
                {% endif %}
                {% if population_change > 0 %}
                    (increase of {{population_change|percentage:0}})
                {% else %}
                    (decrease of {{population_change|percentage:0}})
                {% endif %}
            {% endif %}
            </td>
        </tr>
        <tr><td></td><td></td></tr>
        <tr><td></td><td></td></tr>
    </tbody>
</table>
</div>

<h3>Temperature</h3>
    <div id="temp" style="display: none">
        <p>More information on the Temperature data layers can be found <a href="http://www.worldclim.org/" target="_blank">here</a>.
    </div>
<div class='freetext'>
<p>
<table  style='width:430px' class='analysis_report_container'>
    <tbody>
        <tr class="grey">
            <td>
                <b>Median Minimum Temperature</b>
                <sup><a id="displayText" href="javascript:toggleDiv('min_temp');">Learn More</a><sup>
                <div id="min_temp" style="display: none">
                    <p>The median value of the minimum temperature during the coldest month.  
                    <p>More information on the Temperature datasets can be found <a href="http://www.worldclim.org/" target="_blank">here</a>.
                </div>
            </td>
        </tr>
        <tr>
            <td>
                {% if min_temp_c == default_value %}
                    No Data Available
                {% else %}
                    {{min_temp_c|floatformat:0}}&deg; Celsius / {{min_temp_f|floatformat:0}}&deg; Fahrenheit
                {% endif %}
            </td>
        </tr>
        <tr><td></td><td></td></tr>
        <tr><td></td><td></td></tr>
        <tr class="grey">
            <td>
                <b>Median Maximum Temperature</b>
                <sup><a id="displayText" href="javascript:toggleDiv('max_temp');">Learn More</a><sup>
                <div id="max_temp" style="display: none">
                    <p>The median value of the maximum temperature during the hottest month.  
                    <p>More information on the Temperature datasets can be found <a href="http://www.worldclim.org/" target="_blank">here</a>.
                </div>
            </td>
        </tr>
        <tr>
            <td>
                {% if max_temp_c == default_value %}
                    No Data Available
                {% else %}
                    {{max_temp_c|floatformat:0}}&deg; Celsius / {{max_temp_f|floatformat:0}}&deg; Fahrenheit
                {% endif %}
            </td>
        </tr>
        <tr><td></td><td></td></tr>
        <tr><td></td><td></td></tr>
        <tr class="grey">
            <td colspan='2'>
                <b>Mean Annual Temperature</b>
                <sup><a id="displayText" href="javascript:toggleDiv('temp_avg');">Learn More</a><sup>
                <div id="temp_avg" style="display: none">
                    <p>More information on the Temperature datasets can be found <a href="http://www.worldclim.org/" target="_blank">here</a>.
                </div>
            </td>
        </tr>
        <tr>
            <td colspan='2'>
                {% if annual_temp_c == default_value %}
                    No Data Available
                {% else %}
                    {{annual_temp_c|floatformat:0}}&deg; Celsius / {{annual_temp_f|floatformat:0}}&deg; Fahrenheit
                {% endif %}
            </td>
        </tr>
        <tr><td></td><td></td></tr>
        <tr><td></td><td></td></tr>
        <tr class="grey">
            <td colspan='2'>
                <b>Mean Annual Temperature Range</b>
                <sup><a id="displayText" href="javascript:toggleDiv('temp_range');">Learn More</a><sup>
                <div id="temp_range" style="display: none">
                    <p>The difference between the median mimimum temperature and the median maximum temperature.  
                    <p>More information on the Temperature datasets can be found <a href="http://www.worldclim.org/" target="_blank">here</a>.
                </div>
            </td>
        </tr>
        <tr>
            <td colspan='2'>
                {% if annual_temp_range_c == default_value %}
                    No Data Available
                {% else %}
                    {{annual_temp_range_c|floatformat:0}}&deg; Celsius / {{annual_temp_range_f|floatformat:0}}&deg; Fahrenheit
                {% endif %}
            </td>
        </tr>
        <tr><td></td><td></td></tr>
        <tr><td></td><td></td></tr>
    </tbody>
</table>
</div>

<h3>Precipitation</h3>
<div class='freetext'>
<p>
<table  style='width:430px' class='analysis_report_container'>
    <tbody>
        <tr class="grey">
            <td colspan='2'>
                <b>Mean Annual Precipitation</b>
                <sup><a id="displayText" href="javascript:toggleDiv('avg_precip');">Learn More</a><sup>
                <div id="avg_precip" style="display: none">
                    <p>The average yearly rainfall.  
                    <p>More information on the Precipitation dataset can be found <a href="http://www.worldclim.org/" target="_blank">here</a>.
                </div>
            </td>
        </tr>
        <tr>
            <td colspan='2'>
                {% if annual_precip_cm == default_value %}
                    No Data Available
                {% else %}
                    {{annual_precip_cm|floatformat:0}} cm / {{annual_precip_in|floatformat:0}} in
                {% endif %}
            </td>
        </tr>
        <tr><td></td><td></td></tr>
        <tr><td></td><td></td></tr>
    </tbody>
</table>
</div>
<p>

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript">
function toggleDiv(divId) {
   $("#"+divId).toggle();
}
</script>

<style type="text/css">
h3 { font-weight: bold; }
</style>

{% endblock panel %}
